/* 基本重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 根变量 */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #f59e0b;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #ffffff;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* 基础样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

html {
    scroll-behavior: smooth;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 页面加载动画 */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loader-text {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 2px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 导航栏 */
.navbar {
    background-color: var(--bg-color);
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: var(--bg-light);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 3px 0;
    transition: 0.3s;
}

/* 主要内容 */
main {
    margin-top: 70px;
}

/* 英雄区域 */
.hero {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(30, 64, 175, 0.9)), 
                url('https://images.unsplash.com/photo-1517180102446-f3ece451e9d8?w=1920&h=1080&fit=crop') center/cover;
    color: white;
    padding: 100px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s both;
}

.cta-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease 0.4s both;
}

.cta-button:hover {
    background-color: #d97706;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* 关于我部分 */
.about {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--bg-light) 0%, #e0e7ff 100%);
    position: relative;
    overflow: hidden;
}

.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('https://images.unsplash.com/photo-1555066931-4365d14bab8c?w=1920&h=1080&fit=crop') center/cover;
    opacity: 0.05;
    z-index: 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary-color);
    position: relative;
    z-index: 1;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: flex-start;
    position: relative;
    z-index: 1;
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-light);
}

.skills h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.skills-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.skills-list li {
    background-color: var(--bg-color);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    border-left: 4px solid var(--primary-color);
    font-weight: 500;
    transition: transform 0.2s ease;
}

.skills-list li:hover {
    transform: translateX(5px);
    background-color: #e0e7ff;
}

/* 时间线样式 */
.timeline {
    margin-bottom: 2rem;
}

.timeline h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.timeline-item {
    display: flex;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.timeline-year {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    min-width: 100px;
    text-align: center;
    margin-right: 1rem;
    box-shadow: var(--shadow);
}

.timeline-content {
    flex: 1;
}

.timeline-content h4 {
    color: var(--text-color);
    margin-bottom: 0.3rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.timeline-content p {
    color: var(--text-light);
    margin: 0;
    font-size: 0.95rem;
}

/* 成就样式 */
.achievements h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.achievements-list {
    list-style: none;
}

.achievements-list li {
    background-color: var(--bg-color);
    padding: 1rem;
    margin-bottom: 0.8rem;
    border-radius: 10px;
    border-left: 4px solid var(--accent-color);
    font-weight: 500;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.achievements-list li:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.profile-img {
    width: 100%;
    max-width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    border: 5px solid var(--bg-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    filter: saturate(1.1);
    transform: translateY(-50px);
}

.about-image {
    margin-top: -30px;
}

.profile-img:hover {
    transform: translateY(-50px) scale(1.05) rotate(2deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* 项目部分 */
.projects {
    padding: 80px 0;
    background: var(--bg-color);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background-color: var(--bg-color);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.project-card:hover::before {
    opacity: 0.1;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image {
    transform: scale(1.05);
}

.project-info {
    padding: 1.5rem;
    position: relative;
    z-index: 2;
    background: var(--bg-color);
}

.project-info h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.project-info p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.project-link:hover {
    background-color: var(--secondary-color);
}

/* 联系部分 */
.contact {
    padding: 80px 0;
    background: linear-gradient(135deg, #f0f9ff 0%, var(--bg-light) 100%);
    position: relative;
    overflow: hidden;
}

.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('https://images.unsplash.com/photo-1555421689-491a97ff2040?w=1920&h=1080&fit=crop') center/cover;
    opacity: 0.03;
    z-index: 0;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    position: relative;
    z-index: 1;
}

.contact-info h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.contact-info p {
    margin-bottom: 2rem;
    color: var(--text-light);
}

.contact-list {
    list-style: none;
}

.contact-list li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-light);
}

.contact-list li::before {
    content: '•';
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.contact-form {
    background-color: var(--bg-color);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.submit-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

.submit-button:hover {
    background-color: var(--secondary-color);
}

/* 社交媒体链接 */
.social-media {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.social-media h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.social-links-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.social-link-email,
.social-link-wechat,
.social-link-github,
.social-link-website {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--bg-light);
    border-radius: 25px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.social-link-email:hover {
    background-color: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
    transform: translateY(-2px);
}

.social-link-wechat:hover {
    background-color: #07c160;
    color: white;
    border-color: #07c160;
    transform: translateY(-2px);
}

.social-link-github:hover {
    background-color: #333;
    color: white;
    border-color: #333;
    transform: translateY(-2px);
}

.social-link-website:hover {
    background-color: #4a90e2;
    color: white;
    border-color: #4a90e2;
    transform: translateY(-2px);
}

.social-icon {
    font-size: 1.2rem;
}

/* 联系表单标题 */
.contact-form h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.3rem;
}

/* 页脚 */
.footer {
    background-color: var(--text-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.social-links {
    margin-top: 1rem;
}

.social-link {
    color: white;
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: var(--accent-color);
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--bg-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow);
        padding: 2rem 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .social-links-horizontal {
        justify-content: center;
    }
    
    .social-link-email,
    .social-link-wechat,
    .social-link-github,
    .social-link-website {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    .profile-img {
        margin: 0 auto;
        display: block;
        transform: translateY(-30px);
    }
    
    .about-image {
        margin-top: -20px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

@media screen and (max-width: 480px) {
    .hero {
        padding: 60px 0;
    }
    
    .about,
    .projects,
    .contact {
        padding: 60px 0;
    }
    
    .project-links {
        flex-direction: column;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
}